package seminar.evaluate;

import seminar.Semester;

/**
 * Evaluate amount of lectures per day
 * @author Johannes Degler
 *
 */
public class LecturesPerDayEvaluator implements IEvaluator{

	private int calcPoints(final int count){
		switch(count){
		case 1:
			return -8;
		case 2:
			return -1;
		case 5:
			return -3;
		case 6:
			return -8;
		default:
			return 0;
		}
	}


	@Override
	public int getPoints(final Semester semester) {
		int points = 0;

		for(int day = 0; day < 5; day++){
			int count = 0;
			for(int slot = 0; slot < 6; slot++)
				if(semester.getEvents()[day][slot] != null)
					count++;
			points += this.calcPoints(count);
		}

		return points;
	}
}
